﻿using Bricks.Business.Models.BidManagement;
using Bricks.Business.Models.Document;
using Bricks.Component.Utils;
using Bricks.Site.Models.BidInfo;
using Bricks.Site.Models.Document;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Bricks.Business.Service
{
    public interface IDocumentService
    {
        #region 属性
        /// <summary>
        /// 获取查询数据集
        /// </summary>
        IQueryable<DocumentInfo> Documents { get; }
        #endregion

        #region 公共方法
        ///// <summary>
        ///// 新增
        ///// </summary>
        ///// <param name="model"></param>
        ///// <returns></returns>
        //OperationResult Add(Document model);

        ///// <summary>
        ///// 修改
        ///// </summary>
        ///// <param name="model"></param>
        ///// <returns></returns>
        //OperationResult Modify(Document model);

        /// <summary>
        /// 删除
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        OperationResult Delete(List<Guid> ids);

        /// <summary>
        /// 保存文档列表
        /// </summary>
        /// <param name="instanceID"></param>
        /// <param name="tag"></param>
        /// <param name="list"></param>
        /// <returns></returns>
        OperationResult SaveDocumentList(Guid instanceID, string tag, List<DocumentView> list);

        /// <summary>
        /// 保存通过百度editor直接上传的文件列表
        /// </summary>
        /// <param name="list"></param>
        /// <returns></returns>
        OperationResult SaveRichTextBoxDocumentList(List<UEditorDocumentView> list, Guid instanceID, string attachmentTag);

        /// <summary>
        /// 获取文档信息（根据实例ID和标识Tag）
        /// </summary>
        /// <param name="instanceID"></param>
        /// <param name="tag"></param>
        /// <returns></returns>
        DocumentInfo GetDoumentInfo(Guid instanceID, string tag);

        /// <summary>
        /// 根据实例删除（当删除记录时，需将关联的文档记录删除）
        /// </summary>
        /// <param name="instanceID"></param>
        /// <returns></returns>
        bool DeleteByInstanceID(Guid instanceID);
        #endregion
    }
}
